package com.bbx.taxi.client.Task;

import android.app.Activity;

import com.bbx.androidapi.util.SharedPreUtil;
import com.bbx.androidapi.util.ToastUtil;
import com.bbx.api.sdk.model.base.BaseRequest;
import com.bbx.api.sdk.model.passanger.CouponCountBuild;
import com.bbx.api.sdk.model.passanger.WeightOrVolumnBuild;
import com.bbx.api.sdk.net.base.BaseNetwork;
import com.bbx.api.sdk.net.base.JsonBuild;
import com.bbx.api.sdk.net.passeger.conn.CancelReasonListNet;
import com.bbx.api.sdk.net.passeger.conn.CouponCountNet;
import com.bbx.api.sdk.net.passeger.conn.WeightNet;
import com.bbx.taxi.client.Bean.Message.ObserverListener.DATA_TYPE;
import com.bbx.taxi.client.Task.BaseAsyncTask;
import com.bbx.api.util.SharedPreEncryptUtil;
import com.bbx.taxi.client.MyApplication;
import com.bbx.taxi.client.R;
import com.bbx.taxi.client.Task.DetailsOfGoodsTask.OnFinishListener;

public class CancelReasonListTask extends BaseTask{
    public DATA_TYPE TYPE=DATA_TYPE.CANCELREASON;
    private BaseRequest mBaseRequest;
	public CancelReasonListTask(Activity context) {
		super(context);
		MyApplication mApplication =MyApplication.getInstance();
		mBaseRequest = new BaseRequest(context);
		mBaseRequest.uid = mApplication.getUid();
		mBaseRequest.access_token = mApplication.getToken();
	}
	@Override
	public boolean isShow() {
		return true;
	}

	@Override
	public boolean isReturnString() {
		return true;
	}
	@Override
	public boolean condition() {
		// TODO Auto-generated method stub
		return true;
	}
	@Override
	public void request() {
		setType(TYPE,mBaseRequest);
	}
	@Override
	public void success(int status,Object object) {
		SharedPreUtil.putStringValue(context,
				SharedPreEncryptUtil.cancel_reason_json, (String) object);
	}
	@Override
	public void failed(int status, String msg,String message) {
		ToastUtil.showToast(context,
				context.getResources().getString(R.string.no_network));
	}
	@Override
	public BaseNetwork getBaseNetwork() {
		return new CancelReasonListNet(context);
	}
}
